<script setup lang="ts">
const props = defineProps({
    visible: {
        type: Boolean,
        default: false,
        required: true
    },
    equipmentId: {
        type: Number,
        required: true
    },
    username: {
        type: String,
        required: true
    }
})

const emits = defineEmits(['update:visible'])

const visible_2 = ref(props.visible)

watch(() => props.visible, (newVal) => {
    visible_2.value = newVal
})

watch(() => visible_2.value, (newVal) => {
    emits('update:visible', newVal)
})


const repairForm = reactive({
    equipmentId: 0,
    username: '',
    date: '',
    reason: ''
})
</script>

<template>
    <el-dialog v-model="visible_2" title="维修申请" :before-close="(() => { })()">
        <el-form v-model="repairForm">
            <el-form-item label="资产编号 : ">
                {{ equipmentId }}
            </el-form-item>
            <el-form-item label="申请人 : ">

            </el-form-item>
            <el-form-item label="申请日期 : "></el-form-item>
            <el-form-item label="报修原因 : ">
                <el-input type="textarea" v-model="repairForm.reason" />
            </el-form-item>
        </el-form>
    </el-dialog>
</template>